Earning salvation by trying to live a good life seems like a reasonable idea. If it's granted for any other reason, doesn't that imply that trying to live a good life is meaningless?
Romans 11: 32 For God has consigned all to disobedience, that he may have mercy on all. ESV
Romans 3: 20 Therefore by the deeds of the law there shall no flesh be justified in his sight
If you or I were running the show, we would likely have some sort of merit system. This works in school, it works in business, etc. But, we are not running the show, and we did not create the whole thing, so we don't get to dictate the terms.
God has decided that the spirit of man is unfixable, it must die. God is not asking us to agree to something that he wasn't willing to do himself. But, all the same he is asking us to die to ourselves and abandon ourselves to a new spirit that he will personally give each person when they decide to trust in Jesus alone.
So, while works are important, they are not necessary for Salvation. The are necessary to prove Salvation. Once a person is born again, his good works are acceptable, but he can only take credit for them insomuch that he recognizes they have come from the new spirit and are free from every vestige of the sin nature.
To the unregenerated man, this is an outrage. But, in God's economy, the more you work for Salvation, the more sin debt you will owe on Judgment Day. Think about that!
"Now to him that worketh is the reward not reckoned of grace, but of debt.” - Romans 4: 4